<%@page language="java" contentType="text/html"%>
<%@page import="org.pomirkovany.beans.Item"%>
<%@page import="java.util.Enumeration"%>
<%@page import="java.util.Hashtable"%>
<jsp:useBean id="dataAccess" scope="application"
  class="org.pomirkovany.model.DataAccess"/>
<%
  String base = (String)application.getAttribute("base");
  String imageURL = (String)application.getAttribute("imageURL");
  %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <title>Item details</title>
  <link rel="stylesheet" href="/Cataloguer/css/cataloguer.css" type="text/css"/>
  </head>
<body>
<jsp:include page="header.jsp" flush="true"/>
<jsp:include page="SearchBar.jsp" flush="true"/>
<jsp:include page="typesmenu.jsp" flush="true"/>
<div class="content">
  <h2>Add item</h2>
  
  <form style="border: 0px solid; padding: 0; margin: 0;">
      <input type="hidden" name="action" value="itemEntered"/>
      name<br /><input id="text" type="text" name="name" size="45"/><br />
      author<br /><input id="text" type="text" name="author" size="45"/><br />
      owner<br /><input id="text" type="text" name="owner" size="45"/><br />
      borrowed<br /><input type="checkbox" name="borrowed" value="true" /> <br />
      location<br /><input id="text" type="text" name="location" size="45"/><br />
      comment<br /><input id="text" type="text" name="comment" size="45"/><br />
      
      category<br /><select name="category">
      <% 
    Hashtable categories = dataAccess.getCategories();
    Enumeration categoryIds = categories.keys();
    while (categoryIds.hasMoreElements()) {
      Object categoryId = categoryIds.nextElement();%>
		<option value="<% out.print(categories.get(categoryId)); %>"><% out.print(categories.get(categoryId)); %></option>
        <% }%>
		</select><br /><br />
        
        rate<br />
        <input type="radio" name="rate" value="1" checked/> <img src="<%=(imageURL)%>1s.png" width="16%" height="16%"/><br />
 		<input type="radio" name="rate" value="2" /> <img src="<%=(imageURL)%>2s.png" width="16%" height="16%"/><br />
        <input type="radio" name="rate" value="3" /> <img src="<%=(imageURL)%>3s.png" width="16%" height="16%"/><br />
        <input type="radio" name="rate" value="4" /> <img src="<%=(imageURL)%>4s.png" width="16%" height="16%"/><br />
        <input type="radio" name="rate" value="5" /> <img src="<%=(imageURL)%>5s.png" width="16%" height="16%"/><br /><br />
       
        
        
       
      
      <input id="submit" type="submit" value="add item"/>
    </form>  
    

  </div>
</body>
</html>
